package com.w2e.travel.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@ConditionalOnProperty(prefix = "upload" ,name = "enable")
public class UploadConfig implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/w2e/image/**").addResourceLocations("file:D:/user/mavenImage/");

        registry.addResourceHandler("/w2e/**")
                .addResourceLocations("file:D:/java/git/git local/s3/where-2-escape/w2e-gateway/src/main/resources/static/w2e/");
    }
}
